package scuts.core.classes;

import scuts.core.types.Ordering;

//@:typeClass
class Show<T> {
  public function show (v:T):String {
    throw "abstract";
  }
}


class ShowString implements Show<String> {
  
  // boilerplate, should be avoided
  public static var get(getInstance, null):ShowString;
  
  static function getInstance ()
  {
    if (get == null) get = new ShowString();
    return get;
  }
  function new () {}
  //
  
  override public function show (v:String):String {
    return v;
  }
}

class ShowBool implements Show<Bool> {
  
  // boilerplate, should be avoided
  public static var get(getInstance, null):ShowBool;
  
  static function getInstance ()
  {
    if (get == null) get = new ShowBool();
    return get;
  }
  function new () {}
  //
  
  override public function show (v:Bool):String {
    return Std.string(v);
  }
}